package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the DRAWTYPE database table.
 * 
 */
@Entity
@NamedQuery(name="Drawtype.findAll", query="SELECT d FROM Drawtype d")
public class Drawtype implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="DRAWTYPE_TYPENO_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DRAWTYPE_TYPENO_GENERATOR")
	private Long typeno;

	private String tname;

	//bi-directional many-to-one association to Drawtypeword
	@OneToMany(mappedBy = "drawtype"/* ,fetch=FetchType.EAGER */)
	@JSONField(serialize=false)
	private List<Word> words;

	public Drawtype() {
	}

	public Long getTypeno() {
		return this.typeno;
	}

	public void setTypeno(Long typeno) {
		this.typeno = typeno;
	}

	public String getTname() {
		return this.tname;
	}

	public void setTname(String tname) {
		this.tname = tname;
	}

	public List<Word> getWords() {
		return this.words;
	}

	public void setWords(List<Word> words) {
		this.words = words;
	}

	@Override
	public String toString() {
		return "Drawtype [typeno=" + typeno + ", tname=" + tname + "]";
	}

//	public Word addWord(Word word) {
//		getWords().add(word);
//		word.setDrawtypes(this);
//
//		return word;
//	}
//
//	public Word removeWord(Word word) {
//		getDrawtypewords().remove(word);
//		word.setDrawtype(null);
//
//		return word;
//	}
	
}